import { getInfo } from "@/api/cultivation";

const getDefaultState = () => {
  return {};
};

const state = getDefaultState();

const mutations = {};

const actions = {
  //按植物ID查询
  async getInfo({ state }, plantId) {
    return new Promise((resolve, reject) => {
      getInfo(plantId).then(response => {
        if (response.success) {
          resolve(response.data);
        } else {
          reject(response);
        }
      });
    });
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
